package com.leo.dao;

import javax.annotation.Resource;

import com.leo.entity.User;

public class UserDaoImp implements UserDao {
	@Resource
	private Dao dao;
	
	@Override
	public User findUser(String username){
		return dao.find(User.class, "username=?", username);
	}

	@Override
	public void updateUser(User u){
		dao.update(u);
	}

	@Override
	public void addUser(User u){
		dao.save(u);
	}

	@Override
	public void deleteUsers(String usernameSet){
		dao.delete(User.class, "username", usernameSet.split(","));
	}
}
